import { axios } from '@/utils/request'

export function queryRole (parameter) {
  return axios({
    url: '/role/query',
    method: 'post',
    data: parameter
  })
}

export function addRole (parameter) {
  return axios({
    url: '/role/add',
    method: 'post',
    data: parameter
  })
}

export function editRole (parameter) {
  return axios({
    url: '/role/update',
    method: 'post',
    data: parameter
  })
}

export function removeRole (parameter) {
  return axios({
    url: '/role/remove',
    method: 'post',
    data: parameter
  })
}

export function listPermission4Tree (parameter) {
  return axios({
    url: '/role/listPermission4Tree',
    method: 'post',
    data: parameter
  })
}

export function listPermissionByRoleId4Tree (parameter) {
  return axios({
    url: '/role/listPermissionByRoleId4Tree',
    method: 'post',
    data: parameter
  })
}

export function authorize (parameter) {
  return axios({
    url: '/role/authorize',
    method: 'post',
    data: parameter
  })
}

export function listRole (parameter) {
  return axios({
    url: '/role/listRole',
    method: 'post',
    data: parameter
  })
}

export function updateRoleOrder (parameter) {
  return axios({
    url: '/role/updateOrder',
    method: 'post',
    data: parameter
  })
}
